Skip to content

强制解绑 - ForceUnBind

函数简介

在新设备上凭 激活码 解绑旧设备上的绑定关系(换机场景)。与 解绑 - UnBind 不同:

  • 不要求 当前设备已有有效授权;
  • 必须 传入待解绑的激活码;
  • 软件发布者须在后台软件管理页面中开启「开放客户端解绑」(ClientUnbindEnabled),并配置换绑规则。

典型流程:ForceUnBind(激活码) → Activate(同一激活码) → Login

返回数据格式与 UnBind 相同:

json
{
  "Code": 1,
  "ServerTime": "2026-04-24 10:00:00.000",
  "Message": "",
  "LicenceKeys": ["xxxx-xxxx-xxxx"]
}
字段名说明
Code1=成功,0=失败
Time服务器时间戳(毫秒)
Message提示信息;失败时多为 错误码:中文描述(如 "2003:参数无效")。完整对照见 客户端错误码说明
LicenseKey被解绑的激活码

常见错误码(Message 字段)

格式:{错误码}:{中文描述}

Message含义
2003:参数无效参数无效(如激活码为空)
2004:用户不存在用户不存在
2005:软件不可用或未开通软件不可用或未开通
2013:未开放客户端解绑须在后台开启 ClientUnbindEnabled
2099:…解绑业务失败(冒号后可能为具体原因)
2099:未知错误未知错误

完整对照见 客户端错误码说明

接口名称

ForceUnBind

DLL 调用

long ForceUnBind(string userCode, string softCode, string softVersion, string dealerCode, string licenseKey);

参数说明

参数名类型说明
userCode字符串用户码
softCode字符串软件码
softVersion字符串软件版本
dealerCode字符串经销商码
licenseKey字符串必填,待解绑的激活码

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// result.Code == 1 表示解绑成功
csharp
using OLAPlug;

var ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// result.Code == 1 表示解绑成功
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
json_result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")
# Python SDK 返回 JSON 字符串,需自行解析
java
import com.olaplug.OLAPlugServer;
import com.olaplug.model.OlaAuthUnbindReturn;

OLAPlugServer ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// result.Code == 1 表示解绑成功
go
import "github.com/ola/olaplug/olaplug"

ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
result := ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")
// result.Code == 1 表示解绑成功
rust
use olaplug::OLAPlugServer;

let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let result = ola.force_un_bind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// result.code == 1 表示解绑成功
cpp
var ola = com("OlaPlug.OlaSoft")
var result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
Set result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")
text
.局部变量 ola, OLAPlug
.局部变量 result, OlaAuthUnbindReturn
ola.创建 ()
result = ola.ForceUnBind(“userCode”, “softCode”, “1.0.0”, “dealerCode”, “DK-XXXX-XXXX”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var json = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// Aardio SDK 返回 JSON 字符串,需自行解析
text
变量 ola <类型 = OLAPlugServer>
变量 result <类型 = OlaAuthUnbindReturn>
ola = 新建 OLAPlugServer
result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.ForceUnBind("userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
// result.Code == 1 表示解绑成功

原生 DLL 调用

cpp
ForceUnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long ForceUnBind(string userCode, string softCode, string softVersion, string dealerCode, string licenseKey);

ForceUnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.ForceUnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode", "DK-XXXX-XXXX")

服务端 HTTP 路径

插件内部请求:

POST /api/services/app/ola/forceUnbind

返回值

返回值说明
非 0成功,返回 JSON 字符串格式的结果
0失败

与 UnBind 的对比

项目UnBindForceUnBind
当前设备授权必须有不需要
licenseKey可选(空=解绑本机全部)必填
软件开关须开启客户端解绑
换机场景不适用推荐

注意事项

项目说明
释放内存返回的字符串指针需调用 FreeStringPtr
二次激活解绑成功后须在新设备调用 Activate,再 Login
发布者配置须在欧拉后台为软件开启「开放客户端解绑」并配置换绑规则
一码多设备若激活码同时绑定多个设备,接口会失败,需联系客服
错误码Code == 0Message2013: 开头表示未开放客户端解绑;完整码表见 客户端错误码说明